from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^dawn/', include('dawn.foo.urls')),
    
    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
    (r'^admin/(.*)', admin.site.root),
    
    (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': './media'}),
    (r'^upload/(?P<path>.*)$', 'django.views.static.serve', {'document_root': './upload'}),

    
    (r'^/?$', 'dawn.default.views.index'),
)

#accounts app urlconf
urlpatterns += patterns('dawn.accounts.views',
    (r'^accounts/reg/$', 'reg'),
    (r'^accounts/login/$', 'login'),
    (r'^accounts/logout/$', 'logout'),
    (r'^accounts/waitactivation/$', direct_to_template, {'template': 'accounts/wait_activation.html'}),
    (r'^accounts/editpicture/$', 'edit_picture'),
)

#userhome app urlconf
urlpatterns += patterns('dawn.userhome.views',
    (r'^home/$', 'home'),
    (r'^profile/(\d+)/$', 'profile'),
    (r'^updatestatus/$', 'update_status'),
)

#inbox app urlconf
urlpatterns += patterns('dawn.inbox.views',
    (r'^inbox/$', 'inbox'),
    (r'^outbox/$', 'outbox'),
    (r'^inbox/sendmessage/$', 'send_message'),
    (r'^inbox/readmessage/(\d+)/$', 'read_message'),
    (r'^inbox/delmessage/(\d+)/', 'delete_message'),
)

#friends app urlconf
urlpatterns += patterns('dawn.friends.views',
    (r'^friends/$', 'friends'),
    (r'^friends/addgroup/$', 'add_friend_group'),
)